package top.zhangjianyong.utils.file;

/**
 * @program: topzhangjianyongutils
 * @description: 文件工具类
 * @author: 张建勇
 * @create: 2019-03-15 15:39
 **/
public class FileUtil {

    public static String getExtensionByFileName(String fileName) {

        int index = fileName.lastIndexOf(".");
        int length = fileName.length();
        return fileName.substring(index, length);
    }

    public static void main(String[] args) {
        System.out.println(getExtensionByFileName("123.jpg"));
    }

}
